#ifndef STREAMSTATION_HPP
#define STREAMSTATION_HPP
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include "threados.hpp"
#include "queue.hpp"
#include "method.hpp"

#define STREAMSTATION_MAX_SURPPORT		32
#define STREAMSTATION_MAX_BUFFLEN			1024
#define STREAM_MAX_BUFFLEN						256

namespace systemos
{	
	class stream
	{
		private:
			Queue *mQueue;
		public:
			typedef enum
			{
				STREAM_DIRECT_PUBLIC = 0,
				STREAM_DIRECT_SUBSCRIBE,
			}StreamDirectTPDF;
			
			typedef struct
			{
				uint8_t ucBuff[STREAM_MAX_BUFFLEN];
				uint16_t usLen;
			}StreamPackTPDF;
			
			const char* Name;
			StreamDirectTPDF StreamDirect;
			uint16_t Size;
			
			stream(const char* cName, StreamDirectTPDF tStreamDirect, uint16_t usSize);
			~stream(void);
			void Public(void *tag);
			bool Subscribe(void *tag);
	};
	
	class streamstation
	{
		public:
			static void Init(void);
			static bool Register(stream *tStream);
			static void Unregister(stream *tStream);
	};
}

#endif
